package com.chencs.biz.member.controller;

import com.chencs.biz.member.service.MemberService;
import framework.model.ResponseOptUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by fangzehua on 2017/7/6.
 */
@RequestMapping("/member")
@RestController
public class MemberController {

    @Autowired
    private MemberService memberService;

    @RequestMapping(value = "/doMemberList", method = RequestMethod.GET)
    public ModelAndView doFavoriteList() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("admin/biz/member/member_list");
        return modelAndView;
    }

    @RequestMapping(value = "/memberList", method = RequestMethod.GET)
    public String list() {
        String retStr = "";
        try {
            retStr = memberService.getList();
        } catch (Exception e) {
            retStr = ResponseOptUtil.commonMsgError( ResponseOptUtil.RET_FAIL_MSG);
            e.printStackTrace();
        }
        return retStr;
    }
}
